import os
import time

import alert as alert
from selenium import webdriver
from selenium.webdriver.common.by import By

# print(os.path.abspath(__file__))
# print(os.path.dirname(os.path.abspath(__file__)))
# exit(0)

file = "file:///" + os.path.abspath("../html4") + "/upload_file.html"
driver = webdriver.Chrome()
driver.get(file)

file1 =os.path.dirname(os.path.abspath(__file__)) + "/02 弹窗处理.py"

driver.find_element(By.NAME, "file").send_keys(file1)

time.sleep(3)
driver.quit()
